/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.ipo.mm.ejb.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.FetchType;

/**
 *
 * @author makcro
 */
@Embeddable
public class DocumentPK implements Serializable {
    @Basic(optional = false, fetch=FetchType.EAGER)
    @Column(name = "ID")
    private Integer id;

    @Basic(optional = false, fetch=FetchType.EAGER)
    @Column(name = "Meeting", nullable=false)
    private Integer meeting;

    public DocumentPK() {
    }

    public DocumentPK(Integer id, Integer meeting) {
        this.id = id;
        this.meeting = meeting;
    }

    public int getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getMeeting() {
        return meeting;
    }

    public void setMeeting(Integer meeting) {
        this.meeting = meeting;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        hash += (meeting != null ? meeting.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DocumentPK)) {
            return false;
        }
        DocumentPK other = (DocumentPK) object;
        if (!this.id.equals(other.id)) {
            return false;
        }
        if (!this.meeting.equals(other.meeting)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.ipo.mm.ejb.entities.DocumentPK[id=" + id + ", meeting=" + meeting + "]";
    }

}
